﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Novel_Reading.Controls
{
    public class TextBoxExt : TextBox
    {
        public static readonly DependencyProperty TextBoxRealHeightProperty = DependencyProperty.Register("TextBoxRealHeight", typeof(double), typeof(TextBoxExt));

        public double TextBoxRealHeight
        {
            get
            {
                return (double)GetValue(TextBoxRealHeightProperty);
            }
            set
            {
                SetValue(TextBoxRealHeightProperty, value);
            }
        }
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            this.Loaded += TextBoxExt_Loaded;

        }

        private void TextBoxExt_Loaded(object sender, RoutedEventArgs e)
        {
            TextBoxRealHeight = this.ActualHeight;
        }

        protected override void OnTextChanged(TextChangedEventArgs e)
        {
            base.OnTextChanged(e);
        }


    }
}
